package gui;


import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

public class RoomReservationGui extends JFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7478989716176066437L;
	private JPanel contentPane;
	private JPanel panel;
	

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					RoomReservationGui frame = new RoomReservationGui();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public RoomReservationGui() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 703, 482);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JButton btnStartside = new JButton("StartSide");
		btnStartside.setBounds(0, 30, 133, 25);
		contentPane.add(btnStartside);
		
		JButton btnNewButton = new JButton("RoomReservation");
		btnNewButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
			}
		});
		btnNewButton.setBounds(0, 54, 133, 25);
		contentPane.add(btnNewButton);
		
		JButton btnNewButton_1 = new JButton("FacilityReservation");
		btnNewButton_1.setBounds(0, 78, 133, 25);
		contentPane.add(btnNewButton_1);
		
		JButton btnNewButton_2 = new JButton("Hire Instuctor");
		btnNewButton_2.setBounds(0, 102, 133, 25);
		contentPane.add(btnNewButton_2);
		
		JButton btnShow = new JButton("show");
		btnShow.setBounds(0, 126, 133, 25);
		contentPane.add(btnShow);
		
		JButton btnNew = new JButton("new");
		btnNew.setBounds(0, 150, 133, 25);
		contentPane.add(btnNew);
		
		JButton btnNewButton_3 = new JButton("Show Available");
		btnNewButton_3.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				showAvailableHandel();
			}
		});
		btnNewButton_3.setBounds(0, 174, 133, 25);
		contentPane.add(btnNewButton_3);
		
		JButton btnNewButton_4 = new JButton("Create Guest");
		btnNewButton_4.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				showGuestCreator();
			}
		});
		btnNewButton_4.setBounds(0, 198, 133, 25);
		contentPane.add(btnNewButton_4);
		
		JButton btnCreateReservation = new JButton("Create Reservation");
		btnCreateReservation.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				showReservationCreator();
			}
		});
		btnCreateReservation.setBounds(0, 222, 133, 25);
		contentPane.add(btnCreateReservation);
		
		JButton btnAddRoom = new JButton("Add Room");
		btnAddRoom.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				showRoomAdder();
			}
		});
		btnAddRoom.setBounds(0, 246, 133, 25);
		contentPane.add(btnAddRoom);
		
		panel = new JPanel();
		panel.setBounds(131, 0, 554, 435);
		contentPane.add(panel);
		panel.setLayout(new BorderLayout(0, 0));
		
		
		
	}

	private void showAvailableHandel() {
		panel.removeAll();
		panel.add(new ShowAvailable(),BorderLayout.CENTER);
		panel.validate();
	}
	
	private void showGuestCreator() {
		panel.removeAll();
		panel.add(new CreateGuest(), BorderLayout.CENTER);
		panel.validate();
	}
	
	private void showReservationCreator() {
		panel.removeAll();
		panel.add(new CreateReservation(), BorderLayout.CENTER);
		panel.validate();
	}
	
	private void showRoomAdder(){
		panel.removeAll();
		panel.add(new AddRoom(), BorderLayout.CENTER);
		panel.validate();
	}
	
	
}
